package com.fenghongzhang.day014;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

import java.util.Timer;
import java.util.TimerTask;

import javax.security.auth.login.LoginException;

public class MyService extends Service {

    private static final String TAG = "MyService";
    
    public MyService() {
    }



    class MyBinder extends Binder{
        public void callShow(){
            show();
        }

        public void callShow2(){
            show2();
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.i(TAG, "onBind: ");
        return new MyBinder();
    }


    @Override
    public boolean onUnbind(Intent intent) {
        Log.i(TAG, "onUnbind: ");
        return super.onUnbind(intent);
    }

    //掉用这个方法
    public void show(){
        Log.i(TAG, "show: ");
    }

    //掉用这个方法
    public void show2(){
        Log.i(TAG, "show: 22");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG, "onCreate: ");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(TAG, "onStartCommand: ");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy: ");
    }
}
